package kao;


import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		ArrayList List = new ArrayList();
		while (true) {
			String choose = in.nextLine();
			int x = chooseToInt(choose);
			switch (x) {
			case 1: {
				String str = in.nextLine();
				int n = Integer.valueOf(str);
				if (n <= 0)
					break;
				int a[] = new int[n];
				for (int i = 1; i <= n; i++) {
					a[i - 1] = fib(i);
				}
				for (int i = 0; i < a.length - 1; i++) {
					System.out.print(a[i] + " ");
				}
				System.out.println(a[a.length - 1]);
				break;
			}
			case 2: {
				List.removeAll(List);
				String s = in.nextLine();
				String[] sourceStrArray = s.split(" ");
				for (int j = 0; j < sourceStrArray.length; j++) {
					List.add(Integer.valueOf(sourceStrArray[j]));
				}
				Collections.sort(List);
				System.out.println(List);
			}
				break;
			case 3:
				String str = in.nextLine();
				int num = Integer.valueOf(str);
				System.out.println(List.indexOf(num));
				break;
			case 4:
				String str1 = in.nextLine();
				int num2 = Integer.valueOf(str1);
				for (int i = 0; i < num2; i++) {
					String str2 = in.nextLine();
					getBir(str2);
				}
				break;
			default: {
				System.out.println("exit");
				break;
			}
			}
		}
	}

	private static void getBir(String str) {
		System.out.println(str.substring(6, 10) + "-" + str.substring(10, 12)
				+ "-" + str.substring(12, 14));
	}

	private static int fib(int n) {
		if (1 == n)
			return 1;
		if (2 == n)
			return 1;
		else
			return fib(n - 1) + fib(n - 2);
	}

	private static int chooseToInt(String choose) {
		if (choose.equals("fib"))
			return 1;
		else if (choose.equals("sort"))
			return 2;
		else if (choose.equals("search"))
			return 3;
		else if (choose.equals("getBirthDate"))
			return 4;
		return 0;
	}
}
